package com.kd.crawler.entity;

import com.kd.utils.DateUtils;

public class Document {
	/**
	 * 标题  (Length<=100)
	 */
	private String title;

	/**
	 * 正文  (Length<=1000)
	 */
	private String content;

	/**
	 * 发布日期
	 */
	private Long date;
	
	/**
	 * 作者
	 */
	private String author;
	
	/**
	 * 评论数
	 */
	private Integer commentNum=0;
	
	/**
	 * 点击数
	 */
	private Integer clickNum=0;
	
	/**
	 * 类型 1: 新闻 2：视频 3:论坛 4：问答/知道 5：平媒 6：博客
	 */
	private Integer type;
	/**
	 * 数据源
	 */
	private String url;

	/**
	 * 来源（出处) 对应JOB表 jobId
	 */
	private Integer source;

	/**
	 * 地区ID
	 */
	private Integer addressValue;

	/**
	 * 网站等级
	 */
	private Integer level;
	
	private String updateUrl;
	
	private int entryID;
	
	private int jobId;
	private Long crawlTime;

	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content =content==null?"":content.trim();
	}

	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author =author==null?"":author.trim();
	}
	public Integer getCommentNum() {
		return commentNum;
	}
	public void setCommentNum(Integer commentNum) {
		this.commentNum = commentNum;
	}
	public Integer getClickNum() {
		return clickNum;
	}
	public void setClickNum(Integer clickNum) {
		this.clickNum = clickNum;
	}
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title =title==null?"":title.trim();
	}

	public Long getDate() {
		return date;
	}

	public void setDate(Long date) {
		this.date = date;
	}

	public Integer getSource() {
		return source;
	}
	public Integer getAddressValue() {
		return addressValue;
	}
	public void setAddressValue(Integer addressValue) {
		this.addressValue = addressValue;
	}
	public void setSource(Integer source) {
		this.source = source;
	}	
	public int getEntryID() {
		return entryID;
	}
	public void setEntryID(int entryID) {
		this.entryID = entryID;
	}
	public int getJobId() {
		return jobId;
	}
	public void setJobId(int jobId) {
		this.jobId = jobId;
	}
	public String getUpdateUrl() {
		return updateUrl;
	}
	public void setUpdateUrl(String updateUrl) {
		this.updateUrl = updateUrl;
	}
	public void setCrawlTime(Long crawlTime) {
		this.crawlTime = crawlTime;
	}
	public Long getCrawlTime() {
		return crawlTime;
	}
	@Override
	public String toString() {
		return "BasicMeta [title=" + title + 
				", content=" + content + 
				", date=" + (date==null?null:DateUtils.format(date, "yyyy-MM-dd HH:mm:ss")) + 
				", author=" + author +
				", commentNum=" + commentNum + 
				", clickNum=" + clickNum + 
				", type=" + type + 
				", url=" + url + 
				", source=" + source + 
				", addressValue=" + addressValue +
				", level=" + level + "]";
	}
	
	
}